<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>随手快递</title>
    <link rel="stylesheet" type="text/css" href="../../AUI/css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../font-awesome/css/font-awesome.min.css" />
    <style type="text/css">
        .user-info {
            background-color: #ffffff;
            padding: 0.75rem 0;
        }
        img.avatar {
            display: block;
            margin: 0 auto;
            width: 20%;
        }
        .aui-list .aui-list-header {
            background-color: #ffffff;
            line-height: 1.2rem;
        }
    </style>
</head>
<body style="font-family: 微软雅黑">
<header class="aui-bar aui-bar-nav" id="aui-header" >
    <a class="aui-btn aui-pull-left" tapmode onclick="location.href='../helpBuy/index.html'">
        <span class="aui-iconfont aui-icon-left"></span>
    </a>
    <div class="aui-title">个人资料</div>
    <div class="aui-btn aui-pull-right" id="edit" onclick="editInfo(this)" ><span class="fa fa-edit fa-lg"></span></div>
</header>
<section class="aui-content user-info aui-text-center aui-margin-b-15" style="margin-top: 45px;height:150px;background: url('../../myImage/39.jpg')">
</section>
<section class="aui-content" style="background:#fff;margin-top:-15px">
  <img id="headPortraitUrl" class="avatar aui-img-round" style="position:fixed;margin:-40px 0 0 30px">
  <div style="margin:0 0 10px 130px;">
    <h2 class="aui-margin-t-15" id="nickname" style="font-family: 微软雅黑"></h2>
        <div class="aui-margin-t-5" style="font-size: 15px;color: rgb(249, 150, 30)">
            信誉分：<span id="userCredit"></span>
        </div>
    <div class="aui-margin-t-5" style="font-size: 15px;color: rgb(125, 129, 255)">
        积分：<span id="integral">87</span>
    </div>
    <div id="permissions" style="display:none">
    <div class="aui-margin-t-5" style="font-size: 15px;color: #2f2f2f;">
        快递好评度：<span class="fa fa-star-o" style="color: #ff2d03"></span>
    </div>
    <div class="aui-margin-t-5" style="font-size: 15px;color: #2f2f2f;">
        快递订单数：<span id="sumOrder"></span>
    </div>
    </div>
    </div>
    <ul class="aui-list aui-list-noborder " >
        <li class="aui-list-item aui-border-b"   style="border-top:1px solid #ddd !important">
            <div class="aui-list-item-inner">
                <div class="aui-list-item-title">地区：</div>
                <div class="aui-list-item-text" id="region"></div>
            </div>
        </li>
        <li class="aui-list-item" >
            <div class="aui-list-item-inner">
                <div class="aui-list-item-title">个性签名：</div>
                <div class="aui-list-item-text" style="padding: 5px 0" id="signature"></div>
            </div>

        </li>
    </ul>
</section>
</body>
<script type="text/javascript" src="../../AUI/script/api.js" ></script>
<script src="../../myJs/jquery.js"></script>
<script src="../../myJs/jquery.cookie.js"></script>
<script type="text/javascript">
    apiready = function () {
    }

   /*  var data={
        "code":200,
        "msg":{
            "userId": "33",
            "nickname": "嘿嘿",
            "creditScore": "98",
            "integral": "99",
            "region": "杭州",
            "signature": "这个人很懒",
            "headPortraitUrl": "../../myImage/6.jpg",
            "sex": "男"
        }
    } */

    $(function(){
          $.ajax({
         type: "post",
         url: '/randomdelivery/userManageController/infomation',
         data: {},
         datatype: "json",
         success: function (data) {
        	 //alert(JSON.stringify(data));
        	 viewInfo(data);
         }

         });
        
    })
   
    function viewInfo(data){
        
        //$("#edit").attr("userId",data.userId);
        $("#headPortraitUrl").attr("src",data.msg.headPortraitUrl);
        if(data.msg.sex=="女"){
            $("#nickname").html(data.msg.nickname+'&nbsp;<i class="aui-iconfont aui-icon-my aui-text-danger"></i>');
        }else{
            $("#nickname").html(data.msg.nickname+'&nbsp;<i class="aui-iconfont aui-icon-my"></i>');
        }
        $("#userCredit").html(data.msg.creditScore);
        $("#integral").html(data.msg.integralScore);
        $("#region").html(data.msg.region);
        $("#signature").html(data.msg.signature);
        if(data.msg.permissions!=0){
        	$("#permissions").show();
        	 (data.msg.sumOrder==null?$("#sumOrder").html("0"):$("#sumOrder").html(data.msg.sumOrder));
        }



    }
    function editInfo(node){
        
        window.location.href="editInfo.html";
    }
</script>
</html>